<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yoursite.com","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="git命令使用教程：1.正常维护操作修改代码后，在仓库目录下执行下面命令 123$ git add . #将当前目录所有文件添加到git暂存区$ git commit -m &quot;my first commit&quot; #提交并备注提交信息$ git push origin master #将本地提交推送到远程仓库">
<meta property="og:type" content="article">
<meta property="og:title" content="git命令使用教程">
<meta property="og:url" content="http://yoursite.com/2020/06/20/git%E5%91%BD%E4%BB%A4%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/index.html">
<meta property="og:site_name" content="编程学习笔记">
<meta property="og:description" content="git命令使用教程：1.正常维护操作修改代码后，在仓库目录下执行下面命令 123$ git add . #将当前目录所有文件添加到git暂存区$ git commit -m &quot;my first commit&quot; #提交并备注提交信息$ git push origin master #将本地提交推送到远程仓库">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-06-20T04:35:53.362Z">
<meta property="article:modified_time" content="2020-06-20T04:36:35.308Z">
<meta property="article:author" content="szj">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://yoursite.com/2020/06/20/git%E5%91%BD%E4%BB%A4%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>git命令使用教程 | 编程学习笔记</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">编程学习笔记</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/06/20/git%E5%91%BD%E4%BB%A4%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="szj">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="编程学习笔记">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          git命令使用教程
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-06-20 12:35:53 / 修改时间：12:36:35" itemprop="dateCreated datePublished" datetime="2020-06-20T12:35:53+08:00">2020-06-20</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="git命令使用教程："><a href="#git命令使用教程：" class="headerlink" title="git命令使用教程："></a>git命令使用教程：</h2><h3 id="1-正常维护操作"><a href="#1-正常维护操作" class="headerlink" title="1.正常维护操作"></a>1.正常维护操作</h3><p>修改代码后，在仓库目录下执行下面命令</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ git add . #将当前目录所有文件添加到git暂存区</span><br><span class="line">$ git commit -m &quot;my first commit&quot; #提交并备注提交信息</span><br><span class="line">$ git push origin master #将本地提交推送到远程仓库</span><br></pre></td></tr></table></figure>

<a id="more"></a>

<h3 id="2-本地全新开始一个项目仓库的方法："><a href="#2-本地全新开始一个项目仓库的方法：" class="headerlink" title="2.本地全新开始一个项目仓库的方法："></a>2.本地全新开始一个项目仓库的方法：</h3><p>本地初始化一个仓库，设置远程仓库地址后再做pushs</p>
<p>先进入本地项目文件夹，</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ git init</span><br><span class="line">$ git remote add origin https:&#x2F;&#x2F;gitee.com&#x2F;用户个性地址&#x2F;HelloGitee.git</span><br></pre></td></tr></table></figure>

<p>这样就完成了版本的一次初始化。<br>接下去，进入你已经初始化好的或者克隆仓库的目录,然后执行：</p>
<p><code>$ git pull origin master</code><br>修改/添加文件，否则与原文件相比就没有变动。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ git add .</span><br><span class="line">$ git commit -m &quot;第一次提交&quot;</span><br><span class="line">$ git push origin master</span><br></pre></td></tr></table></figure>

<h3 id="3-gitee仓库的容量限制："><a href="#3-gitee仓库的容量限制：" class="headerlink" title="3.gitee仓库的容量限制："></a>3.gitee仓库的容量限制：</h3><p>社区版（个人用户）</p>
<table>
<thead>
<tr>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>仓库数量</td>
<td>创建 1000 个仓库，不限制公私有。</td>
</tr>
<tr>
<td>仓库容量</td>
<td>Git 单仓库容量上限为 500M ，SVN 单仓库容量上限为 400M</td>
</tr>
<tr>
<td>单文件最大</td>
<td>100M</td>
</tr>
<tr>
<td>用户总仓库容量为</td>
<td>5G</td>
</tr>
<tr>
<td>注：总仓库定义为用户名下以及所创建的组织下面的所有仓库。</td>
<td></td>
</tr>
<tr>
<td>附件容量</td>
<td>附件单文件大小上限为 100MB</td>
</tr>
<tr>
<td>单仓库附件总容量</td>
<td>1G</td>
</tr>
<tr>
<td>成员人数</td>
<td>公有仓库成员数量不限。</td>
</tr>
<tr>
<td>个人账号下所有私有仓库总的协作人数</td>
<td>5人</td>
</tr>
</tbody></table>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/06/16/%E6%89%BE%E5%87%BA%E6%96%87%E4%BB%B6%E5%A4%B9%E9%87%8C%E7%9A%84%E6%96%B0%E5%A2%9E%E6%96%87%E4%BB%B6/" rel="prev" title="找出文件夹里的新增文件">
      <i class="fa fa-chevron-left"></i> 找出文件夹里的新增文件
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/07/14/%E8%8E%B7%E5%8F%96%E7%BD%91%E9%A1%B5%E4%B8%AD%E6%8C%87%E5%AE%9A%E6%A0%87%E7%AD%BE%E7%9A%84%E5%B1%9E%E6%80%A7%E5%80%BC/" rel="next" title="获取网页中指定标签的属性值">
      获取网页中指定标签的属性值 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#git命令使用教程："><span class="nav-number">1.</span> <span class="nav-text">git命令使用教程：</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-正常维护操作"><span class="nav-number">1.1.</span> <span class="nav-text">1.正常维护操作</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-本地全新开始一个项目仓库的方法："><span class="nav-number">1.2.</span> <span class="nav-text">2.本地全新开始一个项目仓库的方法：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-gitee仓库的容量限制："><span class="nav-number">1.3.</span> <span class="nav-text">3.gitee仓库的容量限制：</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">szj</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">18</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">szj</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
